-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ResponseActions): Add click state #382
base: main
Are you sure you want to change the base?
feat(ResponseActions): Add click state #382
Conversation
Preview: https://chatbot-pr-chatbot-382.surge.sh A11y report: https://chatbot-pr-chatbot-382-a11y.surge.sh |
d39d4ea
to
ef0b576
Compare
@@ -79,7 +79,7 @@ You can add actions to a message, to allow users to interact with the message co | |||
|
|||
### Custom message actions | |||
|
|||
Beyond the standard message actions (positive, negative, copy, share, or listen), you can add custom actions to a bot message by passing an `actions` object to the `<Message>` component. This object can contain the following customizations: `ariaLabel`, `onClick`, `className`, `isDisabled`, `tooltipContent`, `tooltipProps`, and `icon`. | |||
Beyond the standard message actions (positive, negative, copy, share, or listen), you can add custom actions to a bot message by passing an `actions` object to the `<Message>` component. This object can contain the following customizations: `ariaLabel`, `clickedAriaLabel`, `onClick`, `className`, `isDisabled`, `tooltipContent`, `tooltipContent`, `tooltipProps`, and `icon`. `clickedAriaLabel` and `clickedTooltipContent` are applied only when a button is clicked. If `clickedAriaLabel` or `clickedTooltipContent` are omitted, they will default to the `ariaLabel` or `tooltipContent` supplied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beyond the standard message actions (positive, negative, copy, share, or listen), you can add custom actions to a bot message by passing an `actions` object to the `<Message>` component. This object can contain the following customizations: `ariaLabel`, `clickedAriaLabel`, `onClick`, `className`, `isDisabled`, `tooltipContent`, `tooltipContent`, `tooltipProps`, and `icon`. `clickedAriaLabel` and `clickedTooltipContent` are applied only when a button is clicked. If `clickedAriaLabel` or `clickedTooltipContent` are omitted, they will default to the `ariaLabel` or `tooltipContent` supplied. | |
Beyond the standard message actions (good response, bad response, copy, share, or listen), you can add custom actions to a bot message by passing an `actions` object to the `<Message>` component. This object can contain the following customizations: | |
- `ariaLabel` | |
- `onClick` | |
- `className` | |
- `isDisabled` | |
- `tooltipContent` | |
- `tooltipContent` | |
- `tooltipProps` | |
- `icon` | |
You can apply a `clickedAriaLabel` and `clickedTooltipContent` once a button is clicked. If either of these props are omitted, their values will default to the `ariaLabel` or `tooltipContent` supplied. |
do you think changing this to a list is more digestible?
Another idea is to remove the list of props and just link to the props table, since there's more context for each of these props down there? I think I lean to this solution if you think it's okay, but I'll let you choose between the 2!
Beyond the standard message actions (good response, bad response, copy, share, or listen), you can add custom actions to a bot message via the
actions
object props.You can apply a
clickedAriaLabel
andclickedTooltipContent
once a button is clicked. If either of these props are omitted, their values will default to theariaLabel
ortooltipContent
supplied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to do option 2, but we have a problem with the docs framework right now where if you click an anchor link, it doesn't take you there, and I hate it. If it's ok with you, I'll go with the first one for now and we can totally change it later.
packages/module/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md
Show resolved
Hide resolved
26e9dab
to
91d345f
Compare
Add click state to response actions block. The last currently selected item will remain selected. Clients can also pass in custom tooltips or aria labels based on the clicked state.
…mples/Messages/Messages.md Co-authored-by: Erin Donehoo <105813956+edonehoo@users.noreply.github.com>
91d345f
to
64633dc
Compare
Add click state to response actions block. The last currently selected item will remain selected until you click someone else on the screen. Clients can also pass in custom tooltips or aria labels based on the clicked state.
Docs:
I've been working directly with Kayla on these already - she has seen them.